import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {HomeComponent} from './components/home/home.component';
import {Code404Component} from './components/code404/code404.component';
import {LoginGuard} from "./gurad/login.guard";
import {UnsaveGuard} from "./gurad/unsave.guard";
import {ProductResolveGuard} from "./gurad/product-resolve.guard";
import {ProductDetailComponent} from "./components/product-detail/product-detail.component";

const routes: Routes = [
  {path: '', redirectTo: 'home', pathMatch: 'full'},
  {path: 'home', component: HomeComponent},
  {path: 'product/:prductId', component: ProductDetailComponent},
  {path: '**', component: Code404Component}
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [LoginGuard, UnsaveGuard, ProductResolveGuard]
})
export class AppRoutingModule {
}
